package com.example.demo.service;

import org.flowable.engine.repository.Deployment;
import org.flowable.engine.repository.ProcessDefinition;

import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * @Author: njz
 * @Description:
 * @Date: create in 2022/2/11 11:24
 */
public interface MyProcessService {
    /**
     * 下载已部署流程图
     * @param proicessDefinitionId
     * @param response
     * @throws UnsupportedEncodingException
     */
    void getProcessView(String proicessDefinitionId, HttpServletResponse response) throws UnsupportedEncodingException;

    /**
     * 分页获取已部署的流程
     * @return
     */
    List<Deployment> getDeploymentList(Integer page, Integer size);

    /**
     * 获取单个部署对象
     * @param id
     * @return
     */
    Deployment getDeployment(String id);

    /**
     * 查询单个流程定义
     * @param deploymentId
     * @return
     */
    ProcessDefinition getProcessByDeploymentId(String deploymentId);

    /**
     * 查询流程定义列表
     * @param deploymentId
     * @return
     */
    List<ProcessDefinition> getProcessList(String deploymentId);

    /**
     * 挂起流程定义
     * @param id
     */
    void suspendProcessDefinitionById(String id);

    /**
     * 恢复流程定义
     * @param id
     */
    void activateProcessDefinitionById(String id);
}
